﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using Prodma.DataAccess.Database;
using Prodma.DataAccess.Models;
using Prodma.DataAccess.Helper.Enumerators;
using System.Web.UI.WebControls;
using System.Web.Mvc;

namespace Prodma.DataAccess.DataService.ListService
{
    public class ImageList
    {
        private static DataContext context = new DataContext();

        public static IList<Tb_FotoGaleri> GetPhotos(int productId)
        {
            DataContext _context = new DataContext();
            using (_context)
            {
                var list = (from pht in _context.Tb_FotoGaleri
                            where pht.UrunID == productId
                            select pht).ToList();

                return list;
            }
        }

        public static IList<Tb_AracFoto> GetAracFoto(int productId)
        {
            DataContext _context = new DataContext();
            using (_context)
            {
                var list = (from pht in _context.Tb_AracFoto
                            where pht.UrunID == productId
                            select pht).ToList();

                return list;
            }
        }
    }
}
